Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • There is no linebreak (new line character) for the Command Window except "{" when used for programming-- correct?

    I was practicing interactive programming using foreach and came across an old Stata list entry from 2003
    http://www.stata.com/statalist/archi.../msg00142.html

    I understand the arguments on both sides, but wondered if I had missed the addition of a new line character since 2003.

    Thanks in advance.

    Mitchell Berman
    Columbia University

  • #2
    Sorry, but I don't understand the question. In using the Command window interactively, pressing Enter is one and the same as ending a line and sending it to Stata. I can't think of another way of doing it.

    Comment


    • #3
      Question is a bit confusing, but:
      - there's no line continuation marker in the command window;
      - the braces {} are not line break characters but used to indicate begin/end of a loop; (and only work when the block is run as a whole in a do file)
      - in a do file you can use /// as a continuation marker.

      Comment


      • #4
        You can use { and } interactively. In each case they would be the last (non-space) character on a command line.

        Comment


        • #5
          Got it. There is no line continuation marker for the Command Window.
          The enter key sends what has been written on the line to Stata; there is no way to continue a long command on a second line, without sending the first (incomplete) line to Stata.
          (except when programming and using the braces {} ).

          Thank you very much.

          Comment


          • #6
            Yes, but the braces aren't an exception. A line like

            Code:
            foreach f of local foo { 
            is syntactically a line; it's just a question of whether what follows makes sense given that prequel. Similarly

            Code:
            }
            is a command line, which may or may not be legal (or useful).

            Comment


            • #7
              Ah, I see your point. In your example, the first line (starting with foreach) IS a complete line.
              I was thinking cosmetically, not functionally.

              Comment

              Working...
              X